﻿Public Class Dog
    Public Shared Age As Integer = 1
    Public Shared Hungry As Integer = 1 '10까지
    Public Shared Life As Integer = 8
    Public Shared DDONGCount As Integer = 0


    Public Shared Sub Run()
        Dim IfDDONG As New Random
        If Life = 0 Then RaiseEvent NoLife()
        Life = +1
        Hungry = -1
        If IfDDONG.Next(0, 1) = 1 Then
            RaiseEvent DDONGNow()
        End If
        If Hungry = 0 Then RaiseEvent VeryHungry()
    End Sub
    Public Shared Event VeryHungry()
    Public Shared Event NoLife()
    Public Shared Event DDONGNow()
    Public Shared Sub Dead() Handles Me.VeryHungry, Me.NoLife
        MsgBox("개가 죽었습니다...", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, "사망")
    End Sub
    Public Shared Sub DDONG() Handles Me.DDONGNow
        If Not MsgBox("개가 똥을 쌋습니다. 치울까요?", MsgBoxStyle.YesNo + MsgBoxStyle.Exclamation) = MsgBoxResult.Yes Then
            DDONGCount = +1
        End If
    End Sub
End Class
Public Class Cat
    Public Shared Age As Integer = 1
    Public Shared Hungry As Integer = 1 '10까지
    Public Shared Life As Integer = 8
    Public Shared DDONGCount As Integer = 0


    Public Shared Sub Run()
        Dim IfDDONG As New Random
        If Life = 0 Then RaiseEvent NoLife()
        Life = +1
        Hungry = -1
        If IfDDONG.Next(0, 1) = 1 Then
            RaiseEvent DDONGNow()
        End If
        If Hungry = 0 Then RaiseEvent VeryHungry()
    End Sub
    Public Shared Event VeryHungry()
    Public Shared Event NoLife()
    Public Shared Event DDONGNow()
    Public Shared Sub Dead() Handles Me.VeryHungry, Me.NoLife
        MsgBox("개가 죽었습니다...", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, "사망")
    End Sub
    Public Shared Sub DDONG() Handles Me.DDONGNow
        MsgBox("고양이가 똥을 쌋으나 본능적으로 치웠습니다!", MsgBoxStyle.Information)
    End Sub
End Class